import ActionTypes from "../action";
import {
  FILTER_OPTION_DATA,
  OPTION_ORDER_STATUS,
  OPTION_DEFAULT_STATUS,
  OPTION_GOODS_TYPE,
  OPTION_RESULT,
  OPTION_PUT_AWAY,
} from "../options";

export default {
  [ActionTypes.ACCOUNT_AUTH]: [
    {
      name: "mobile",
      type: "text",
      label: "手机号码",
      placeholder: "请输入手机号码",
    },
  ],
  // 商品管理
  [ActionTypes.GOODS_MANAGE]: [
    {
      name: "productName",
      type: "text",
      label: "商品名称",
      placeholder: "请输入商品名称",
    },
    {
      name: "productCode",
      type: "text",
      label: "商品编号",
      placeholder: "请输入商品编号",
    },
    {
      name: "productType",
      type: "select",
      label: "商品类型",
      placeholder: "请选择商品类型",
      options: () => OPTION_GOODS_TYPE,
    },
    {
      name: "isHot",
      type: "select",
      label: "热门商品",
      placeholder: "请选择",
      options: () => OPTION_RESULT,
    },
    {
      name: "isRecommend",
      type: "select",
      label: "推荐商品",
      placeholder: "请选择",
      options: () => OPTION_RESULT,
    },
  ],
  [ActionTypes.GOODS_CATEGORY_FIRST]: [
    {
      name: "firstCategoryName",
      type: "text",
      label: "一级分类",
    },
  ],
  [ActionTypes.GOODS_CATEGORY_SECOND]: [
    {
      name: "categoryName",
      type: "text",
      label: "二级分类",
    },
    {
      name: "firstCategoryName",
      type: "text",
      label: "一级分类",
    },
  ],
  // 商户列表
  [ActionTypes.MERCHANT_LIST]: [
    {
      name: "merchantName",
      type: "text",
      label: "姓名",
    },
    {
      name: "mobile",
      type: "number",
      label: "电话",
    },
  ],
  // 商户列表
  [ActionTypes.MERCHANT_AUDIT_LIST]: [
    {
      name: "merchantName",
      type: "text",
      label: "姓名",
    },
    {
      name: "mobile",
      type: "number",
      label: "电话",
    },
  ],
  // 员工管理
  [ActionTypes.PERSONNEL_MANAGE]: [
    {
      name: "staffName",
      type: "text",
      label: "姓名",
    },
    {
      name: "mobile",
      type: "number",
      label: "电话",
    },
  ],
  // 展会管理
  [ActionTypes.EXHIBITION_MANAGE]: [
    {
      name: "exhibitionName",
      type: "text",
      label: "展会名称",
    },
    {
      type: "select",
      label: "省份",
      name: "provinceCode",
      cascader: "cityCode",
      placeholder: "请选择省份",
      options(_, $store) {
        return $store.getters["dic/province"];
      },
      auto_dispatch: "dic/getCityDic",
    },
    {
      type: "select",
      label: "城市",
      name: "cityCode",
      placeholder: "请选择城市",
      options(_, $store) {
        return $store.getters["dic/city"];
      },
      dispatch: "dic/getCity",
    },
    {
      name: "isPutAway",
      type: "select",
      label: "展会状态",
      placeholder: "请选择",
      options: () => OPTION_PUT_AWAY,
    },
  ],
  [ActionTypes.COMMISSION_MANAGE]: [
    {
      type: "select",
      label: "省份",
      name: "provinceCode",
      cascader: "cityCode",
      placeholder: "请选择省份",
      options(_, $store) {
        return $store.getters["dic/province"];
      },
      auto_dispatch: "dic/getCityDic",
      rule: {
        required: true,
        message: "省份不能为空",
        trigger: "blur",
      },
    },
    {
      type: "select",
      label: "城市",
      name: "cityCode",
      placeholder: "请选择城市",
      options(_, $store) {
        return $store.getters["dic/city"];
      },
      dispatch: "dic/getCity",
      rule: {
        required: true,
        message: "城市不能为空",
        trigger: "blur",
      },
    },
  ],
  [ActionTypes.MAINTAIN_ORDER]: [
    {
      type: "number",
      label: "订单号",
      name: "orderId",
    },
    {
      type: "text",
      label: "姓名",
      name: "userName",
    },
    {
      type: "number",
      label: "手机号",
      name: "mobile",
    },
    {
      name: "startTime",
      type: "date",
      label: "开始时间",
      placeholder: "请选择开始时间",
    },
    {
      name: "endTime",
      type: "date",
      label: "结束时间",
      placeholder: "请选择结束时间",
    },
    {
      name: "orderStatus",
      type: "select",
      label: "订单状态",
      options() {
        return OPTION_ORDER_STATUS;
      },
    },
    {
      name: "questionType",
      type: "select",
      label: "问题类型",
      auto_dispatch: "dic/getQuestionTypes",
      options(_, $store) {
        console.log($store.getters["dic/questionTypes"]);
        return $store.getters["dic/questionTypes"];
      },
    },
  ],
  [ActionTypes.ORDER_MANAGE]: [
    {
      name: "orderId",
      type: "number",
      label: "订单编号",
    },
    {
      name: "userName",
      type: "text",
      label: "用户名称",
    },
    {
      name: "mobile",
      type: "number",
      label: "用户电话",
    },
    {
      name: "orderType",
      type: "select",
      label: "订单类型",
      options() {
        return OPTION_GOODS_TYPE;
      },
    },
    {
      name: "orderStatus",
      type: "select",
      label: "订单状态",
      options() {
        return OPTION_DEFAULT_STATUS;
      },
    },
    {
      name: "startTime",
      type: "date",
      label: "开始时间",
    },
    {
      name: "endTime",
      type: "date",
      label: "结束时间",
    },
  ],
  [ActionTypes.USER_CORE_MANAGE]: [
    {
      name: "nickName",
      type: "text",
      label: "昵称",
    },
    {
      name: "mobile",
      type: "text",
      label: "手机号",
    },
  ],
  [ActionTypes.WITHDRAW_MANAGE]: [
    {
      type: "text",
      label: "姓名",
      name: "name",
    },
    {
      type: "text",
      label: "手机号",
      name: "mobile",
    },
    {
      name: "startTime",
      type: "date",
      label: "开始时间",
      placeholder: "请选择开始时间",
    },
    {
      name: "endTime",
      type: "date",
      label: "结束时间",
      placeholder: "请选择结束时间",
    },
    {
      type: "select",
      label: "省份",
      name: "provinceCode",
      cascader: "cityCode",
      placeholder: "请选择省份",
      options(_, $store) {
        return $store.getters["dic/province"];
      },
      auto_dispatch: "dic/getCityDic",
    },
    {
      type: "select",
      label: "城市",
      name: "cityCode",
      placeholder: "请选择城市",
      options(_, $store) {
        return $store.getters["dic/city"];
      },
      dispatch: "dic/getCity",
    },
  ],
  [ActionTypes.COUPON_MANAGE]: [
    {
      type: "select",
      label: "省份",
      name: "provinceCode",
      cascader: "cityCode",
      placeholder: "请选择省份",
      options(_, $store) {
        return $store.getters["dic/province"];
      },
      auto_dispatch: "dic/getCityDic",
    },
    {
      type: "select",
      label: "城市",
      name: "cityCode",
      placeholder: "请选择城市",
      options(_, $store) {
        return $store.getters["dic/city"];
      },
      dispatch: "dic/getCity",
    },
    {
      name: "orderType",
      type: "select",
      label: "订单类型",
      options() {
        return OPTION_GOODS_TYPE;
      },
    },
    {
      name: "startTime",
      type: "date",
      label: "开始时间",
      placeholder: "请选择开始时间",
    },
    {
      name: "endTime",
      type: "date",
      label: "结束时间",
      placeholder: "请选择结束时间",
    },
  ],
  [ActionTypes.MERCHANT_COMMENT_LIST]: [
    {
      name: "userName",
      type: "text",
      label: "用户姓名",
    },
    {
      name: "merchantName",
      type: "text",
      label: "商品姓名",
    },
    {
      name: "startTime",
      type: "date",
      label: "开始时间",
      placeholder: "请选择开始时间",
    },
    {
      name: "endTime",
      type: "date",
      label: "结束时间",
      placeholder: "请选择结束时间",
    },
  ],
  [ActionTypes.USER_CORE_HISTORY]: [
    {
      name: "orderId",
      type: "text",
      label: "订单编号",
    },
    {
      name: "productName",
      type: "text",
      label: "商品名称",
    },
    {
      name: "orderType",
      type: "select",
      label: "订单类型",
      options() {
        return OPTION_GOODS_TYPE;
      },
    },
    {
      name: "exhibitionId",
      type: "select",
      label: "展会",
      auto_dispatch: "dic/getAllExhibition",
      options(_, $store) {
        return $store.getters["dic/usefulExhibition"];
      },
    },
  ],
  [ActionTypes.STATISTICS_USER]: FILTER_OPTION_DATA,
  [ActionTypes.STATISTICS_MERCHANT]: FILTER_OPTION_DATA,
  [ActionTypes.STATISTICS_SERVICE]: FILTER_OPTION_DATA,
  [ActionTypes.STATISTICS_RANGE]: FILTER_OPTION_DATA,
  [ActionTypes.STATISTICS_GOODS]: FILTER_OPTION_DATA,
  [ActionTypes.STATISTICS_TYPE]: FILTER_OPTION_DATA,
  [ActionTypes.STATISTICS_EXHIBITION]: FILTER_OPTION_DATA,
  [ActionTypes.STATISTICS_DATE]: FILTER_OPTION_DATA,
};
